package com.tbit.uqbike.object.pojo.vo;

import com.tbit.uqbike.webmanager.util.csv.annotations.Csv;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class AccountDayStatDownloadAllGiftCardVO {


    private BigDecimal user_recharge_gift_card_sum;
    private BigDecimal user_recharge_gift_card_cnt;

    private BigDecimal user_refunds_deduct_gift_cards_sum;
    private BigDecimal user_refunds_deduct_gift_cards_cnt;


    private BigDecimal manual_recharge_gift_card_sum;
    private BigDecimal manual_recharge_gift_card_cnt;

    private BigDecimal manually_deduct_gift_cards_sum;
    private BigDecimal manually_deduct_gift_cards_cnt;


    private BigDecimal gift_card_redemption_sum;
    private BigDecimal gift_card_redemption_cnt;

    private BigDecimal riding_discount_gift_card_sum;
    private BigDecimal riding_discount_gift_card_cnt;


    @Csv(name = "礼品卡收入金额")
    private BigDecimal card_sum;
    @Csv(name = "礼品卡收入笔数")
    private BigDecimal card_cnt;
    @Csv(name = "礼品卡支出金额")
    private BigDecimal card_expend_sum;
    @Csv(name = "礼品卡支出笔数")
    private BigDecimal card_expend_cnt;


    @Csv(name = "期初预礼品卡总金额")
    private BigDecimal gift_card_at_the_beginning_and_end_of_the_period_start;
    @Csv(name = "期末预礼品卡总金额")
    private BigDecimal gift_card_at_the_beginning_and_end_of_the_period_end;


    public BigDecimal getCard_sum() {
        return (user_recharge_gift_card_sum == null ? BigDecimal.ZERO : user_recharge_gift_card_sum)
                .add(manual_recharge_gift_card_sum == null ? BigDecimal.ZERO : manual_recharge_gift_card_sum)
                .add(gift_card_redemption_sum == null ? BigDecimal.ZERO : gift_card_redemption_sum);
    }

    public BigDecimal getCard_cnt() {
        return (user_recharge_gift_card_cnt == null ? BigDecimal.ZERO : user_recharge_gift_card_cnt)
                .add(manual_recharge_gift_card_cnt == null ? BigDecimal.ZERO : manual_recharge_gift_card_cnt)
                .add(gift_card_redemption_cnt == null ? BigDecimal.ZERO : gift_card_redemption_cnt);
    }

    public BigDecimal getCard_expend_sum() {
        return (user_refunds_deduct_gift_cards_sum == null ? BigDecimal.ZERO : user_refunds_deduct_gift_cards_sum)
                .add(manually_deduct_gift_cards_sum == null ? BigDecimal.ZERO : manually_deduct_gift_cards_sum)
                .add(riding_discount_gift_card_sum == null ? BigDecimal.ZERO : riding_discount_gift_card_sum);
    }

    public BigDecimal getCard_expend_cnt() {
        return (user_refunds_deduct_gift_cards_cnt == null ? BigDecimal.ZERO : user_refunds_deduct_gift_cards_cnt)
                .add(manually_deduct_gift_cards_cnt == null ? BigDecimal.ZERO : manually_deduct_gift_cards_cnt)
                .add(riding_discount_gift_card_cnt == null ? BigDecimal.ZERO : riding_discount_gift_card_cnt);
    }
}
